package logic

import (
	"context"
	"home-info-site/models/mysql"

	"home-info-site/userrpc/internal/svc"
	"home-info-site/userrpc/userrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type ProductDetailLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewProductDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ProductDetailLogic {
	return &ProductDetailLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 详情
func (l *ProductDetailLogic) ProductDetail(in *userrpc.ProductDetailRequest) (*userrpc.ProductDetailResponse, error) {
	// todo: add your logic here and delete this line

	var list *userrpc.ProductDetailResponse
	list = mysql.ProductDetail(mysql.DB, list, in.ProductId)
	return list, nil
}
